﻿<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page import="java.util.List" %>
<%@ page import="entity.Blog" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="util.Page" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>微博-点滴生活，精彩世界</title>
<link href="../styles/global.css" type="text/css" rel="stylesheet" />
<link href="../styles/customerindex.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="../script/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="../script/trim.js" ></script>
<script type="text/javascript" src="../script/customerindex.js" ></script>
</head>

<body style="filter:alpha(opacity=100)" id="totop">

<%@include file="../control/login_control.jsp"%>

<!-- 总容器 container开 始-->
<div id="container">
	    <!-- topDIV 开始 -->
    <%@include file="top.jsp"%>

    <!-- topDIv 结束-->
    <!-- 内容总容器 mainDIV 开 始-->
   <div id="main">
        <!-- 左侧mainBannerDIV 开始 -->
    <div id="mainBanner">
        	<!-- mainBannerTop DIV 开始 -->
      <div id="mainBannerTop">
            <!--id=mainBannerTopIssue 发布框-->
        <div id="mainBannerTopIssue">
                    <!--id=mainBannerTopIssuePoint 提示-->
                    <div id="mainBannerTopIssuePoint">正在发生的事情
                    </div>
                    <div style="float:right;">您还可以输入<span id="counter1">140</span>字！
                    </div>
                    <form action="" method="post" id="">
                      <div id="mainBannerTopIssueForm">
                            <!--id="mainBannerTopIssueFrame-->
                            <div id="mainBannerTopIssueFrame">
                                <label ur="textfield2"></label><textarea name="textfield1" rows="4" class="Size" id="textfield2" style="overflow:hidden;border:1px #0CF solid;" onkeyup="calNum(this,counter1,0)"></textarea>
                            </div>
                            <!--id="mainBannerTopIssueInsert 插入链接-->
                        <div id="mainBannerTopIssueInsert">
                            <!--4个小div-->
                        </div>
                          <!--确认发布-->
                        <div id="mainBannerTopIssueSure">
                          <div id="mainBannerTopIssueSure2"> <a href="file" class="a1">
                            <div id="mainBannerTopIssueInsert1"></div>
                            <div id="mainBannerTopIssueInsert2">插入图片 </div>
                            </a>
                            <a href="javascript:biaoQingXianShi()" class="a1">
                              <div id="mainBannerTopIssueInsert5"></div>
                              <div id="mainBannerTopIssueInsert6">插入表情</div>
                            </a>
                            <input type="button" name="button1" id="button1" value="发布" style="background-color:#3295E6; border:none" onclick="submitState()" />
                          </div>
                        </div>
                        </div>
                    </form> 
          </div>
          <!-- 表情DIV -->
          <div id="biaoqing"><table width="200" border="1" cellspacing="0" cellpadding="0">
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
            </table></div>
        </div> 
            
            <!--id="mainBannerTitle 首页-->
            <div id="mainBannerTitle">
                <!--id="mainBannerTitleWord"-->
                <div id="mainBannerTitleWord"><b>首页</b>&nbsp;&nbsp;&nbsp;&nbsp;<a href="customerindex~.html"><b>热门</b></a>
                </div>
                <div id="mainBannerTitleWord2">
                    <form action="<%=request.getContextPath()%>/BlogServlet?opr=HomeBlogList" method="post" name="form3">
                        <label for="textfield1"></label><input type="text" name="content3" id="textfield1"/>
                        <img src="../images/search.gif" alt="" width="27" height="25" style="border: none; vertical-align: middle;" title=""  onclick="javascript:document.form3.submit()"/>
                    </form>
                </div>
            </div> 
            <!--不同人的内容-->
            <div id="mainBannerContent">


                <c:forEach items="${sessionScope.allblogList}" var="blog">
                <!--个人展示，关注的-->
            	<div class="stateShow" onmouseover="stateMouseOver(this)" onmouseout="stateMouseOut(this)" onclick="go2detail(${blog.id})">
                  <div class="stateShowWord">
                    <table width="450" border="0" cellpadding="0" cellspacing="0" class="stateTable">
                      <tr>
                        <td width="70" align="center" valign="top"><a href="#"><img src="../${blog.user.image}" alt="" width="48" height="48" /></a></td>
                        <td width="380" ><a href="#">${blog.user.nickname}</a><img src="../images/1.gif" style="border:none;vertical-align:middle;" alt=""/>${blog.content} </td>
                      </tr>
                    </table>
                  </div>
                   <div class="stateImgShow"><img src="../${blog.images}" alt=""/></div>
                  <div class="stateShowtime">${blog.time} </div>
                  <div class="stateOp"><a class="opState" onclick="javascript:;" href="#">收藏 100</a><a class="opState" onclick="javascript:;" href="#">回复 100</a><a class="opDone" href="#">转发 100</a><a class="opState" onclick="" href="#">赞 100</a></div>
                  <div class="huifu"></div>
                </div>
                 <!--个人展示结束-->
                </c:forEach>



            </div>
      </div>
      <!-- 左侧mainBanner DIV 结束-->
      <!-- 右侧mainRight DIV开始 -->
  <div id="mainRight">
      <div id="mainRight1">

                    	<!-- 右侧mainRightPostionFirstLine DIV 开始 -->
                    	<div id="mainRightPostionFirstLine">
                            <!-- 右侧mainRightPostionFirstLineIcon DIV 开始 -->
                            <div style="height:58px;">
                            <div id="mainRightPostionFirstLineIcon">
                            	<a href="avatar.jsp"><img src="../<%=user.getImage()%>" alt="" width="48" height="48" style="border:none;vertical-align:middle;" title="" /></a>
                            </div>
                            <!-- 右侧mainRightPostionFirstLineIcon DIV 结束 -->
                            <!-- 右侧mainRightPostionFirstLineWord1 DIV 开始 -->
                            <div id="mainRightPostionFirstLineWord1">                 
                            &nbsp;<span style="color: #005DC3;" ><b><a href="mywb.html" class="a1"><%=user.getNickname()%></a></b></span><br />
                            &nbsp;<%=user.getAddress()%>
                            </div>
                            </div>
                            <!-- 右侧mainRightPostionFirstLineWord1 DIV 结束 -->
                        	<!-- 右侧mainRightPostionFirstLineWord2 DIV 开始 -->
                          <div id="mainRightPostionFirstLineWord2">
                                <ul>
                                	<li><a href="mywb.html" class="a1"><span class="style1">${sessionScope.blogCount}</span><br /><span class="style2">微博</span></a></li>
   								    <li><a href="friend.html" class="a1"><span class="style1">${followCount}</span><br /><span class="style2">关注</span></a></li>
   								    <li><a href="focusonyou.html" class="a1"><span class="style1">${fansCount}</span><br /><span class="style2">粉丝</span></a></li>
                                </ul>
                           </div>
                           <!-- 右侧mainRightPostionFirstLineWord2 DIV 结束 -->                    
                        </div>
                        <!-- 右侧mainRightPostionFirstLine DIV 结束 -->
                        <!-- 右侧mainRightPostionSecondLine DIV 开始 -->
                        <div id="mainRightPostionSecondLine">
                            <!-- 右侧mainRightPositionSecondLineContent DIV 开始 -->
                            <div id="mainRightPositionSecondLineContent">
                                <a href="#" class="a1"><span class="style3">首页</span></a>
                                <hr class="h1">
                                <a href="mycollection.html" class="a1"><span class="style3">我的收藏</span></a>
                                <hr class="h1">
                                <a href="mylike.html" class="a1"><span class="style3">我的赞</span></a>
                            </div>
                            <!-- 右侧mainRightPositionSecondLineContent DIV 开始 -->
                        </div>
                        <!-- 右侧mainRightPostionSecondLine DIV 结束 -->
                      
                    
                    <!-- 右侧mainRightPostionSixthLine DIV 开始 -->
                    <div id="mainRightPostionSixthLine">
                    	<div id="mainRightPositionSixthLineContent">
                        	<a href="#" onclick="" class="a1"><span class="style4">我关注的</span>
                            <img src="../images/ThirdLineUpArrow.gif" alt="" width="12" height="14" style="border: none; vertical-align: middle;" title="" /></a>
                        </div>
                        <ul>
                        	<li><a href="#" class="a1"><img src="../images/WBXM.gif" style="border: none;" alt=""/><br /><span class="style2">微博小秘</span></a></li>
                            <li><a href="#" class="a1"><img src="../images/AXXR.gif" style="border: none;" alt=""/><br /><span class="style2">&nbsp;&nbsp;转&nbsp;&nbsp;发</span></a></li>
                            <li><a href="#" class="a1"><img src="../images/LBXR.gif" style="border: none;" alt=""/><br /><span class="style2">微博新人</span></a></li>
                        </ul>
                    </div>
                    <!-- 右侧mainRightPostionSixthLine DIV 结束 -->
                    <!-- 右侧mainRightPostionSeventhLine DIV 开始 -->
                    <div id="mainRightPostionSeventhLine">
                        <div id="mainRightPositionSevenLineContent">
                        微博的成长，离不开你们。<br />
                        <span class="style2"><a href="#" class="a1">有意见要提（点击） </a><br /><br />
                        <a href="#" class="a1" onclick="set()" >不良信息举报中心</a></span>
                        </div>
                    </div>
                    <!-- 右侧mainRightPostionSeventhLine DIV 结束 -->
        </div>
     </div>
      <!-- 右侧mainRightDiv 结束 -->
  </div>
    <!-- 回复 100DIV 开始 -->
    <!-- 内容总容器 mainDIV 结束-->

    <%
       Page page1=(Page) session.getAttribute("page");
    %>

    <div class="pagination" style="text-align: center">
      <c:if test="${sessionScope.page.currPageNo>1}">
        <a href="<%=request.getContextPath()%>/BlogServlet?opr=HomeBlogList&pageIndex=1">首页</a>
        <a href="<%=request.getContextPath()%>/BlogServlet?opr=HomeBlogList&pageIndex=<%=page1.getPrevPageNo()%>">上一页</a>
      </c:if>
      <c:if test="${sessionScope.page.currPageNo<sessionScope.page.totalPageCount}">
        <a href="<%=request.getContextPath()%>/BlogServlet?opr=HomeBlogList&pageIndex=<%=page1.getNextPageNo()%>">下一页</a>
        <a href="<%=request.getContextPath()%>/BlogServlet?opr=HomeBlogList&pageIndex=<%=page1.getTotalPageCount()%>">尾页</a>
      </c:if>
        <label><%=page1.getCurrPageNo()%>/<%=page1.getTotalPageCount()%>：  共<%=page1.getTotalCount()%>条记录</label>

    </div>

<!-- footer部分 -->
    <%@include file="footer.jsp"%>

    <!-- footer部分结束 -->
    
</div>
<!--总容器 container结束-->
 <p id="backtop"><a id="backtop1" href="#totop"><span>回到顶部</span></a></p>
</body>
<script>
    function go2detail(id) {
	window.open("../control/comment_control.jsp?opr=commentList&id="+id);
}
</script>
</html>
